<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMenusTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('menus', function (Blueprint $table) {
//            $table->comment('菜单表');
            $table->increments('id');
            $table->integer('pid')->default(0);
            $table->string('name', 255)->default('')->comment('菜单名称');
            $table->boolean('type')->default(true)->comment('类型：1-菜单，2-按钮');
            $table->string('desc', 255)->default('')->comment('带单描述');
            $table->integer('sort')->default(0)->comment('排序');
            $table->boolean('status')->default(true)->comment('1-正常 0-隐藏');
            $table->string('path', 255)->default('')->comment('路径');
            $table->string('icon', 255)->default('')->comment('图标');
            $table->boolean('is_ml')->default(false)->comment('0-目录 1-菜单  -1-空');
            $table->string('openType', 25)->default('')->comment('打开方式 ‘_iframe’ ， ‘_blank’');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('menus');
    }
};
